import values from "./string"

// 获取当前页面的标题
function packDocumentTitle(pathname: string) {
  let currentRouterName = values.router_name_index
  switch (pathname) {
    case '/':
      currentRouterName = values.router_name_index
      break
    case '/article/':
      currentRouterName = values.router_name_article
      break
    case '/resume/':
      currentRouterName = values.router_name_resume
      break
    case '/gallery/':
      currentRouterName = values.router_name_gallery
      break
    case '/about/':
      currentRouterName = values.router_name_about
      break
    default:
      currentRouterName = values.short_home_name
      break
  }
  document.title = `${values.short_home_name} | ${currentRouterName}`
}

export {
  packDocumentTitle
}